<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:composite="http://java.sun.com/jsf/composite"
	xmlns:p="http://primefaces.org/ui">
<head></head>
<body>
	<composite:interface>
		<composite:attribute name="beanToUse" />
	</composite:interface>

	<composite:implementation>
		<p:outputPanel>
			<p:panel rendered="#{cc.attrs.beanToUse.show}">
				<h:panelGrid width="100%" columns="2" style="margin-bottom:10px">
					<f:facet name="header">

					</f:facet>
					<p:commandLink style="margin-right:20px;"
						update="#{viewBeanBucket.getUpdateString()}">
						<f:setPropertyActionListener value="#{false}"
							target="#{cc.attrs.beanToUse.show}" />
						<h:outputText value="X" />
					</p:commandLink>
					<h:outputText />
					<h:outputLabel value="Distinguished Name" />
					<h:outputText value="#{ldapTreeBean.selectedNode.ldapObject.dn}" />
					<h:outputLabel value="Group Name" />
					<p:inputText value="#{cc.attrs.beanToUse.ldapGroup.cn}" />

					<h:outputLabel value="Members" />
					<p:tree value="#{selectableUserGroupTree.root}" var="member"
						id="memberTree" dynamic="true" cache="false"
						selectionMode="checkbox">
						<p:ajax event="expand"
							listener="#{selectableUserGroupTree.onNodeExpand}" />

						<p:ajax event="select"
							listener="#{selectableUserGroupTree.onNodeSelect}" />
						<p:ajax event="unselect"
							listener="#{selectableUserGroupTree.onNodeUnselect}" />

						<p:treeNode type="default" icon="ui-icon-document">
							<h:outputText value="#{member.cn}" />
						</p:treeNode>
						<p:treeNode type="root" expandedIcon="ui-icon-folder-open"
							collapsedIcon="ui-icon-folder-collapsed">
							<h:outputText value="#{member.cn}" />
						</p:treeNode>
						<p:treeNode icon="ui-icon-shuffle" type="group">
							<h:outputText value="#{member.cn}" />
						</p:treeNode>
						<p:treeNode type="user" icon="ui-icon-person">
							<h:outputText value="#{member.cn}" />
						</p:treeNode>
						<p:treeNode type="ldapObject">
							<h:outputText value="#{member.cn}" />
						</p:treeNode>
						<p:treeNode type="container" expandedIcon="ui-icon-folder-open"
							collapsedIcon="ui-icon-folder-collapsed">
							<h:outputText value="#{member.cn}" />
						</p:treeNode>
					</p:tree>

					<h:outputLabel value="Member Of" />
					<p:tree value="#{selectableGroupTree.root}" var="node" id="groups"
						dynamic="true" cache="false" selectionMode="checkbox">
						<p:ajax event="expand"
							listener="#{selectableGroupTree.onNodeExpand}" />

						<p:ajax event="select"
							listener="#{selectableGroupTree.onNodeSelect}" />
						<p:ajax event="unselect"
							listener="#{selectableGroupTree.onNodeUnselect}" />
						<p:treeNode type="default" icon="ui-icon-document">
							<h:outputText value="#{node.cn}" />
						</p:treeNode>
						<p:treeNode type="root" expandedIcon="ui-icon-folder-open"
							collapsedIcon="ui-icon-folder-collapsed">
							<h:outputText value="#{node.cn}" />
						</p:treeNode>
						<p:treeNode icon="ui-icon-shuffle" type="group">
							<h:outputText value="#{node.cn}" />
						</p:treeNode>
						<p:treeNode type="user" icon="ui-icon-person">
							<h:outputText value="#{node.cn}" />
						</p:treeNode>
						<p:treeNode type="ldapObject">
							<h:outputText value="#{node.cn}" />
						</p:treeNode>
						<p:treeNode type="container" expandedIcon="ui-icon-folder-open"
							collapsedIcon="ui-icon-folder-collapsed">
							<h:outputText value="#{node.cn}" />
						</p:treeNode>
					</p:tree>

					<h:outputLabel value="" />
					<p:commandButton value="Create"
						action="#{cc.attrs.beanToUse.create()}" ajax="false" />
				</h:panelGrid>

			</p:panel>
		</p:outputPanel>
	</composite:implementation>
</body>
</html>